package com.github.reweber.androidasyncsocketexamples.base;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.github.reweber.androidasyncsocketexamples.R;
import com.github.reweber.androidasyncsocketexamples.dbbean.Life_UserInfo;


/**
 * Created by 他的猫 on 2016/11/21.
 * 反馈适配器
 */

public class DiaoDu_Adapter extends Base_Z_Adapter {
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        DiaoDu_Adapter.Holder holder = null;
        // 查找控件
        if (null == convertView) {
            convertView = LayoutInflater.from(BaseApplication.getInstance())
                    .inflate(R.layout.tab_item_1_diaodu, null);
            holder = new DiaoDu_Adapter.Holder();


            holder.tv_shijian = (TextView) convertView
                    .findViewById(R.id.tv_shijian);
            holder.tv_smname = (TextView) convertView
                    .findViewById(R.id.tv_smname);

            holder.chepaihao = (TextView) convertView
                    .findViewById(R.id.chepaihao);
            holder.tv_shijian1 = (TextView) convertView
                    .findViewById(R.id.tv_shijian1);
            holder.tv_jiaquan = (TextView) convertView
                    .findViewById(R.id.tv_jiaquan);

            // 缓存Holder
            convertView.setTag(holder);
        } else {
            holder = (DiaoDu_Adapter.Holder) convertView.getTag();
        }
        Life_UserInfo nrowDataeme = (Life_UserInfo) getItem(position);
        holder.tv_smname.setText("溫度:" + nrowDataeme.getW());
        holder.chepaihao.setText("湿度:" + nrowDataeme.getS());

        holder.tv_shijian.setText("光照:" + nrowDataeme.getG());
        holder.tv_shijian1.setText("烟雾:" + nrowDataeme.getY());
        holder.tv_jiaquan.setText("甲醛:" + nrowDataeme.getJ());
        return convertView;
    }


    public class Holder {


        TextView tv_smname, tv_shijian, chepaihao, tv_shijian1,tv_jiaquan;


    }
}
